Skip to content

Detect dotted attribute names in STACK_GLOBAL (GHSA-5j3x-jp52-966f)#287

Merged
thomas-chauchefoin-tob merged 2 commits into
masterfrom
fix-ghsa-5j3x-jp52-966f
Jun 26, 2026
Merged

Detect dotted attribute names in STACK_GLOBAL (GHSA-5j3x-jp52-966f)#287
thomas-chauchefoin-tob merged 2 commits into
masterfrom
fix-ghsa-5j3x-jp52-966f

Conversation

@thomas-chauchefoin-tob

Copy link
Copy Markdown
Collaborator

Pickle resolves dotted names in imports, so STACK_GLOBAL "pathlib" "os.system" reaches the real os.system through pathlib. This is not limited to pathlib and would work with any stdlib module that imports a blocklisted module at the top level. We now split import names and compare every element with the blocklists. Thanks to @seankohjs for the report!

Pickle resolves dotted names in imports, so STACK_GLOBAL "pathlib" "os.system"
reaches the real os.system through pathlib. This is not limited to
pathlib, it works with any stdlib module that imports a blocklisted
module at top level

We now split import names and compare every element with the blocklists.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thomas-chauchefoin-tob thomas-chauchefoin-tob merged commit d985f89 into master Jun 26, 2026
11 checks passed
@thomas-chauchefoin-tob thomas-chauchefoin-tob deleted the fix-ghsa-5j3x-jp52-966f branch June 26, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant